let meitiUrl="http://localhost:3006/meiti";
//媒体关注

function appendMeiti(value){
    let liTag=document.createElement("li");
    let aTag=document.createElement("a")
    aTag.href="#";
    aTag.textContent=value.title;
    liTag.appendChild(aTag);
    return liTag;
}


let meitiRes=new XMLHttpRequest();
meitiRes.open("GET",meitiUrl,true);
meitiRes.onreadystatechange=function(){
    if(meitiRes.readyState===4 && meitiRes.status===200){
        let node=document.getElementById("meiti");
        let value=JSON.parse(meitiRes.responseText);
        for(let i=0;i<value.length;i++){
            node.appendChild(appendMeiti(value[i]));
        }
    }
}
meitiRes.send()